package com.pucheng.bracelet.app.database.repository

import androidx.annotation.WorkerThread
import com.pucheng.bracelet.app.database.dao.BPDao
import com.pucheng.bracelet.data.bean.BloodPressureBean
import kotlinx.coroutines.flow.Flow

/**
 * 血氧饱和度
 */
class BPRepository(private val bpDao: BPDao) {

    //查询所有数据
    val allDataTo7Day: Flow<List<BloodPressureBean>> = bpDao.get7Days()

    //查询所有数据
    val allData: Flow<List<BloodPressureBean>> = bpDao.getAll()

    // 插入数据
    @Suppress("RedundantSuspendModifier")
    @WorkerThread
    suspend fun insert(bpBean: BloodPressureBean) {
        bpDao.insert(bpBean)
    }


}